package com.study.springbootsecurity.enums;

public enum BusinessEnum {
    /**
     * 未授权
     */
    UN_AUTHORIZATION(401, "unauthorized"),
    /**
     * 操作失败
     */
    OPERATION_FAIL(-1, "error"),
    /**
     * 拒绝许可
     */
    ACCESS_DENY_FAIL(-1, "Permission denied"),
    /**
     * 未登录
     */
    RESULT_NOT_LOGIN(401,"NotLogin"),
    /**
     * 已存在
     */
    ALREADY_EXISTS(500,"exists"),
    /**
     * 未知错误
     */
    SERVER_INNER_ERROR(-1, "unknown error"),
    /**
     * token过期
     */
    TOKEN_EXPIRATION(401,"token expiration"),
    /**
     * 没有许可
     */
    NO_LICENSE(401,"no license"),
    LICENSE_EXPIRATION(401,"license expiration"),

    TOO_MANY_REQUESTS(401,"too many requests");


    private Integer code;
    private String desc;

    BusinessEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}

